﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using EnvironmentalMonitor.Support.Business.Environmental;
using EnvironmentalMonitor.Support.Business;
using EnvironmentalMonitor.Support.Module.Manage;
using EnvironmentalMonitor.Support.Module;
using EnvironmentalMonitor.Support.Resource;

namespace EnvironmentalMonitor.WebApplication.Environmental.Machine.Setup
{
    /// <summary>
    /// 列表Json数据页面类
    /// </summary>
    public partial class ListJson : EnvironmentalMonitor.WebApplication.Abstract.AbstractListJson
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            User user = this.Session[Constant.SESSION_KEY_USER] as User;

            MachineBusiness business = new MachineBusiness();
            List<EnvironmentalMonitor.Support.Module.Environmental.Machine> modules = business.QueryByUser(user);

            this.ListJsonData = new Abstract.ListJsonData();
            this.ListJsonData.total = modules.Count;
            this.ListJsonData.rows = modules;
            string json = this.Json();

            this.Response.Write(json);
            this.Response.Flush();
            this.Response.End();
        }
    }
}